import { Directive, Input, Optional, TemplateRef, ViewContainerRef, Renderer2, ElementRef, OnInit, NgZone } from '@angular/core';
import { DxDataGridComponent } from 'devextreme-angular/ui/data-grid';
import { DataGridColumnCustomService } from '../../core/service/data-grid-column-custom.service';

@Directive({
  selector: '[bzColumnCustom]'
})
export class ColumnCustomDirective<U, B, S> implements OnInit {

  constructor(
    private dxDataGridComponent: DxDataGridComponent,
    private dataGridColumnCustomService: DataGridColumnCustomService<U, B, S>,
    private ngZone: NgZone
  ) {

  }

  ngOnInit(): void {
    this.ngZone.runOutsideAngular(() => {
      setTimeout(() => {
        this.dataGridColumnCustomService.columnCustom(this.dxDataGridComponent);
      }, 300);
    });

  }
}
